1800 |
How can I highlight somehow the child bars of a summary bar
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->GetBars()->GetItem("Task")->PutColor(RGB(240,240,240)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary = var_Items->AddItem("Summary"); var_Items->AddBar(hSummary,"Project Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"",vtMissing); long hTask = var_Items->InsertItem(hSummary,vtMissing,"Task A"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task B"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); hTask = var_Items->InsertItem(hSummary,vtMissing,"Task C"); var_Items->AddBar(hTask,"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutExpandItem(hSummary,VARIANT_TRUE); var_Items->DefineSummaryBars(hSummary,"",-1,"<*>"); var_Items->PutItemBar(hSummary,"",EXG2ANTTLib::exSummaryBarBackColor,long(65536)); var_Items->PutItemBar(hSummary,"",EXG2ANTTLib::exSummaryBarBackColorTransparent,long(50)); spG2antt1->EndUpdate(); |
1799 |
How do I change the color for the selected bars, without showing the frame arround
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2002,1,1,0,00,00).operator DATE()); var_Chart->PutSelBarColor(0x7f0000ff); var_Chart->PutPaneWidth(VARIANT_FALSE,48); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2002,1,2,0,00,00).operator DATE(),COleDateTime(2002,1,4,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2002,1,6,0,00,00).operator DATE(),COleDateTime(2002,1,10,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2002,1,11,0,00,00).operator DATE(),COleDateTime(2002,1,14,0,00,00).operator DATE(),"C",vtMissing); var_Items->PutItemBar(0,"<A B>",EXG2ANTTLib::exBarSelected,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1798 |
Is it possible to enumerate the activities/bars of critical path
// BarResize event - Occurs when a bar is moved or resized. void OnBarResizeG2antt1(long Item,VARIANT Key) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->SchedulePDM(Item,Key); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->GetBars()->GetItem("Task")->PutDef(EXG2ANTTLib::exBarCaption,"<%=int(%269) > 0 ? (`<b>` + %269 + `</b>`) : ``%>"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long hSummary1 = var_Items->AddItem("Summary"); var_Items->PutItemBold(hSummary1,VARIANT_TRUE); var_Items->AddBar(hSummary1,"Summary",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),"sum",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->DefineSummaryBars(hSummary1,"sum",h1,""); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->DefineSummaryBars(hSummary1,"sum",h2,""); var_Items->AddLink("L1",h1,"",h2,""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->DefineSummaryBars(hSummary1,"sum",h3,""); var_Items->AddLink("L2",h2,"",h3,""); long h4 = var_Items->AddItem("Task 4"); var_Items->AddBar(h4,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->DefineSummaryBars(hSummary1,"sum",h4,""); var_Items->AddLink("L3",h1,"",h4,""); var_Items->PutDefSchedulePDM(EXG2ANTTLib::exPDMCriticalPathBarColor,long(65280)); var_Items->SchedulePDM(h1,""); spG2antt1->EndUpdate(); |
1797 |
How can I add a SF link
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,25,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutLevelCount(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K2",vtMissing); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K3",vtMissing); long h4 = var_Items->AddItem("Task 4"); var_Items->AddBar(h4,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K4",vtMissing); long h5 = var_Items->AddItem("Task 5"); var_Items->AddBar(h5,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K5",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->AddLink("L3",h3,"K3",h4,"K4"); var_Items->AddLink("L4",h4,"K4",h5,"K5"); var_Items->PutLink("L4",EXG2ANTTLib::exLinkStartPos,long(0)); var_Items->PutLink("L4",EXG2ANTTLib::exLinkEndPos,long(2)); var_Items->PutLink("L4",EXG2ANTTLib::exLinkColor,long(65280)); var_Items->SchedulePDM(0,"K5"); spG2antt1->GetChart()->PutShowLinks(EXG2ANTTLib::exShowExtendedLinks); spG2antt1->EndUpdate(); |
1796 |
How do I get the Start and End date of a bar
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); spG2antt1->PutDebug(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,96); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),"K1",vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,25,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2006,9,23,0,00,00).operator DATE(),COleDateTime(2006,9,26,0,00,00).operator DATE(),"K3",vtMissing); long h = var_Items->GetItemByIndex(1); var_Items->PutItemBold(h,VARIANT_TRUE); OutputDebugStringW( L"Start of " ); OutputDebugStringW( _bstr_t(var_Items->GetFirstItemBar(h)) ); OutputDebugStringW( _bstr_t(var_Items->GetItemBar(h,var_Items->GetFirstItemBar(h),EXG2ANTTLib::exBarStart)) ); OutputDebugStringW( L"End of " ); OutputDebugStringW( _bstr_t(var_Items->GetFirstItemBar(h)) ); OutputDebugStringW( _bstr_t(var_Items->GetItemBar(h,var_Items->GetFirstItemBar(h),EXG2ANTTLib::exBarEnd)) ); spG2antt1->EndUpdate(); |
1795 |
I haven't found options to change/localize (in German, or my current regional settings) the captions/text/strings ( dates, tooltip ) that shows in the chart area (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstWeekDay(var_Chart->GetLocFirstWeekDay()); var_Chart->PutMonthNames(var_Chart->GetLocMonthNames()); var_Chart->PutWeekDays(var_Chart->GetLocWeekDays()); var_Chart->PutAMPM(var_Chart->GetLocAMPM()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); |
1794 |
Is it possible to change caption of the print and print preview, as it just says "Untitled Document", but I cant find the code that writes this caption
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); spG2antt1->EndUpdate(); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'EXPRINTLib' for the library: 'ExPrint 1.0 Control Library' #import <ExPrint.dll> using namespace EXPRINTLib; */ EXPRINTLib::IExPrintPtr var_Print = ::CreateObject(L"Exontrol.Print"); var_Print->PutCaption(L"This is your new caption for print and print preview"); var_Print->PutAutoRelease(VARIANT_FALSE); var_Print->PutPrintExt(((EXG2ANTTLib::IG2anttPtr)(spG2antt1))); var_Print->Preview(); |
1793 |
Is it possible to specify the A4 paper size for the print preview
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); spG2antt1->EndUpdate(); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'EXPRINTLib' for the library: 'ExPrint 1.0 Control Library' #import <ExPrint.dll> using namespace EXPRINTLib; */ EXPRINTLib::IExPrintPtr var_Print = ::CreateObject(L"Exontrol.Print"); var_Print->PutSettings(EXPRINTLib::exPaperSize,long(9)); var_Print->PutAutoRelease(VARIANT_FALSE); var_Print->PutPrintExt(((EXG2ANTTLib::IG2anttPtr)(spG2antt1))); var_Print->Preview(); |
1792 |
Is it possible to tell the print preview to open up in "landscape mode" by default, not in "portrait mode"
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); spG2antt1->EndUpdate(); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'EXPRINTLib' for the library: 'ExPrint 1.0 Control Library' #import <ExPrint.dll> using namespace EXPRINTLib; */ EXPRINTLib::IExPrintPtr var_Print = ::CreateObject(L"Exontrol.Print"); var_Print->PutPageOrientation(EXPRINTLib::exLandscape); var_Print->PutAutoRelease(VARIANT_FALSE); var_Print->PutPrintExt(((EXG2ANTTLib::IG2anttPtr)(spG2antt1))); var_Print->Preview(); |
1791 |
How do I prevent a caption outside the bar from overlapping other bars
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->GetBars()->Copy(L"Task",L"Default-Task"); var_Chart->GetBars()->GetItem("Task")->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsIncludeCaption | EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task 1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"A1","task"); var_Items->PutItemBar(h,"A1",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"A2","task"); var_Items->PutItemBar(h,"A2",EXG2ANTTLib::exBarHAlignCaption,long(16)); h = var_Items->AddItem("Task 2"); var_Items->AddBar(h,"Default-Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"A1","task"); var_Items->PutItemBar(h,"A1",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->AddBar(h,"Default-Task",COleDateTime(2001,1,6,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"A2","task"); var_Items->PutItemBar(h,"A2",EXG2ANTTLib::exBarHAlignCaption,long(16)); spG2antt1->EndUpdate(); |
1790 |
How do I clip/hide/align the bar's extra-caption/text based on the bar's size/width/length
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Clip"); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowResizeChartMiddle | EXG2ANTTLib::exAllowResizeChartHeader)); var_Chart->PutDrawGridLines(EXG2ANTTLib::exRowLines); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,23,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,216); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutPattern(EXG2ANTTLib::exPatternBox); var_Bar->PutColor(RGB(164,164,164)); var_Bar->PutStartColor(RGB(240,240,240)); var_Bar->PutEndColor(var_Bar->GetStartColor()); var_Bar->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsIncludeCaption | EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); var_Bar->PutHeight(15); var_Chart->PutMinUnitWidth(var_Chart->GetUnitWidth()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("no clip, (0-2)"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"no clip, right(<b>2</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(2)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"no clip, center(<b>1</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(1)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K3",""); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaption,"no clip, left(<b>0</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaptionHAlign,long(0)); h = var_Items->AddItem("clip, inside (3-5)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"clip, inside, right(<b>5</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(5)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"clip, inside, center(<b>4</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(4)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaption,"clip, inside, left(<b>3</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaptionHAlign,long(3)); h = var_Items->AddItem("hide on min width, clip if not fit, inside (6-8)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,26,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"hide on min width, clip if not fit, inside, right(<b>8</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(8)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,26,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"hide on min width, clip if not fit, inside, center(<b>7</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(7)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,26,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaption,"hide on min width, clip if not fit, inside, left(<b>6</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaptionHAlign,long(6)); h = var_Items->AddItem("hide if not fit, no clip, inside (9-11)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"hide if not fit, no clip, inside, right(<b>11</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(11)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"hide if not fit, no clip, center(<b>10</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(10)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaption,"hide if not fit, no clip, inside, left(<b>9</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaptionHAlign,long(9)); h = var_Items->AddItem("no clip, inside, outside (12-14)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"no clip, inside, outside, right(<b>14</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(14)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"no clip, inside, outside, center(<b>13</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(13)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaption,"no clip, inside, outside, left(<b>12</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaptionHAlign,long(12)); h = var_Items->AddItem("no clip, outside (16-18)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,30,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1",vtMissing); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaption,"no clip, outside, right(<b>18</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(18)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,30,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K2",vtMissing); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaption,"no clip, outside, center(<b>17</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(17)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,30,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K3",vtMissing); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaption,"no clip, outside, left(<b>16</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarExtraCaptionHAlign,long(16)); spG2antt1->EndUpdate(); |
1789 |
What options do I have to show the links between bars (rectangular SEV, starts vertically, ends vertically)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksWidth(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddItem(""); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,13,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"K3",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddItem(""); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,7,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddItem(""); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("<*>",EXG2ANTTLib::exLinkShowRound,long(5)); spG2antt1->EndUpdate(); |
1788 |
What options do I have to show the links between bars (rectangular SV, starts vertically, ends horizontally)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksWidth(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddItem(""); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,13,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"K3",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddItem(""); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,7,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddItem(""); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("<*>",EXG2ANTTLib::exLinkShowRound,long(4)); spG2antt1->EndUpdate(); |
1787 |
What options do I have to show the links between bars (rectangular EV, starts horizontally, ends vertically)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksWidth(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddItem(""); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,13,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"K3",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddItem(""); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,7,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddItem(""); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("<*>",EXG2ANTTLib::exLinkShowRound,long(3)); spG2antt1->EndUpdate(); |
1786 |
What options do I have to show the links between bars (straight)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksWidth(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddItem(""); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,13,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"K3",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddItem(""); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,7,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddItem(""); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("<*>",EXG2ANTTLib::exLinkShowRound,long(2)); spG2antt1->EndUpdate(); |
1785 |
What options do I have to show the links between bars (direct)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksWidth(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddItem(""); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,13,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"K3",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddItem(""); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,7,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddItem(""); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("<*>",EXG2ANTTLib::exLinkShowRound,long(1)); spG2antt1->EndUpdate(); |
1784 |
What options do I have to show the links between bars (round)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksWidth(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddItem(""); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,13,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"K3",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddItem(""); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,7,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddItem(""); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("<*>",EXG2ANTTLib::exLinkShowRound,long(-1)); spG2antt1->EndUpdate(); |
1783 |
What options do I have to show the links between bars (rectangular, default)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutNonworkingDays(0); var_Chart->PutLinksWidth(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(""); long h3 = var_Items->AddItem("Task 3"); var_Items->AddItem(""); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,13,0,00,00).operator DATE(),COleDateTime(2001,1,15,0,00,00).operator DATE(),"K3",vtMissing); long h1 = var_Items->AddItem("Task 1"); var_Items->AddItem(""); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,7,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddItem(""); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("<*>",EXG2ANTTLib::exLinkShowRound,long(0)); spG2antt1->EndUpdate(); |
1782 |
I have a question about whether the control has the functionality to add two bars on the same item, as one would correspond to the item bar and another bar their progress, but progress is required to show dividedly at different times outside the activity bar item
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->Copy(L"Progress",L"TProgressD"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar->PutShape(EXG2ANTTLib::exShapeThinDown); EXG2ANTTLib::IBarPtr var_Bar1 = var_Chart->GetBars()->Copy(L"Progress",L"TProgressC"); var_Bar1->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); EXG2ANTTLib::IBarPtr var_Bar2 = var_Chart->GetBars()->Copy(L"Progress",L"TProgressU"); var_Bar2->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar2->PutShape(EXG2ANTTLib::exShapeThinUp); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,9,30,0,00,00).operator DATE(),"T1",vtMissing); var_Items->AddBar(h,"TProgressU",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,10,4,0,00,00).operator DATE(),"TP1",vtMissing); var_Items->GroupBars(h,"T1",VARIANT_TRUE,h,"TP1",VARIANT_TRUE,long(3),vtMissing); var_Items->PutItemBar(h,"TP1",EXG2ANTTLib::exBarCaption,"<font ;6>progress up"); h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,26,0,00,00).operator DATE(),COleDateTime(2006,10,1,0,00,00).operator DATE(),"T2",vtMissing); var_Items->AddBar(h,"TProgressC",COleDateTime(2006,9,26,0,00,00).operator DATE(),COleDateTime(2006,10,5,0,00,00).operator DATE(),"TP2",vtMissing); var_Items->GroupBars(h,"T2",VARIANT_TRUE,h,"TP2",VARIANT_TRUE,long(3),vtMissing); var_Items->PutItemBar(h,"TP2",EXG2ANTTLib::exBarCaption,"<font ;6>progress center"); h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,9,30,0,00,00).operator DATE(),"T3",vtMissing); var_Items->AddBar(h,"TProgressD",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,10,6,0,00,00).operator DATE(),"TP3",vtMissing); var_Items->GroupBars(h,"T3",VARIANT_TRUE,h,"TP3",VARIANT_TRUE,long(3),vtMissing); var_Items->PutItemBar(h,"TP3",EXG2ANTTLib::exBarCaption,"<font ;6>progress down"); spG2antt1->EndUpdate(); |
1781 |
I have a column of date-type, the question is how can I move the associated bar, instead of resizing it (summary, inclusive, working)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutIndent(11); spG2antt1->PutHasLines(EXG2ANTTLib::exSolidLine); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(544)); var_Column->GetEditor()->PutEditType(EXG2ANTTLib::DateType); var_Column->PutLevelKey(long(1)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(546)); var_Column1->GetEditor()->PutEditType(EXG2ANTTLib::DateType); var_Column1->PutLevelKey(long(1)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,224); EXG2ANTTLib::IBarsPtr var_Bars = var_Chart->GetBars(); EXG2ANTTLib::IBarPtr var_Bar = var_Bars->Add(L"Underline"); var_Bar->PutColor(RGB(0,0,255)); var_Bar->PutShape(EXG2ANTTLib::exShapeThinDown); EXG2ANTTLib::IBarPtr var_Bar1 = var_Bars->Add(L"Task:Underline"); var_Bar1->PutShortcut(L"T"); var_Bar1->PutDef(EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project"); var_Items->AddBar(h,"Summary",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,10,3,0,00,00).operator DATE(),vtMissing,vtMissing); long h1 = var_Items->InsertItem(h,vtMissing,"Task 1"); var_Items->AddBar(h1,"T",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),vtMissing,vtMissing); long h2 = var_Items->InsertItem(h,vtMissing,"Task 2"); var_Items->AddBar(h2,"T",COleDateTime(2006,9,24,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); long h3 = var_Items->InsertItem(h,vtMissing,"Task 3"); var_Items->AddBar(h3,"T",COleDateTime(2006,9,28,0,00,00).operator DATE(),COleDateTime(2006,10,3,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->DefineSummaryBars(h,"",h1,""); var_Items->DefineSummaryBars(h,"",h2,""); var_Items->DefineSummaryBars(h,"",h3,""); var_Items->PutExpandItem(h,VARIANT_TRUE); var_Items->PutItemBold(h,VARIANT_TRUE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarMoveStart,COleDateTime(2006,9,22,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1780 |
I have a column of date-type, the question is how can I move the associated bar, instead of resizing it (summary)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutIndent(11); spG2antt1->PutHasLines(EXG2ANTTLib::exSolidLine); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(544)); var_Column->GetEditor()->PutEditType(EXG2ANTTLib::DateType); var_Column->PutLevelKey(long(1)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(545)); var_Column1->GetEditor()->PutEditType(EXG2ANTTLib::DateType); var_Column1->PutLevelKey(long(1)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_FALSE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,224); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project"); var_Items->AddBar(h,"Summary",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,10,3,0,00,00).operator DATE(),vtMissing,vtMissing); long h1 = var_Items->InsertItem(h,vtMissing,"Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),vtMissing,vtMissing); long h2 = var_Items->InsertItem(h,vtMissing,"Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2006,9,24,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); long h3 = var_Items->InsertItem(h,vtMissing,"Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2006,9,28,0,00,00).operator DATE(),COleDateTime(2006,10,3,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->DefineSummaryBars(h,"",h1,""); var_Items->DefineSummaryBars(h,"",h2,""); var_Items->DefineSummaryBars(h,"",h3,""); var_Items->PutExpandItem(h,VARIANT_TRUE); var_Items->PutItemBold(h,VARIANT_TRUE); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarMoveStart,COleDateTime(2006,9,22,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1779 |
Is it possible to programmatically move all bars of specified key to end at specified date (inclusive)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<A*>",EXG2ANTTLib::exBarMoveEndInclusive,COleDateTime(2001,1,2,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1778 |
Is it possible to programmatically move all bars to end at specified date (inclusive)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarMoveEndInclusive,COleDateTime(2001,1,2,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1777 |
Is it possible to programmatically move all bars of specified key to end at specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<A*>",EXG2ANTTLib::exBarMoveEnd,COleDateTime(2001,1,2,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1776 |
Is it possible to programmatically move all bars to end at specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarMoveEnd,COleDateTime(2001,1,2,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1775 |
Is it possible to programmatically move all bars of specified key to start at specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<A*>",EXG2ANTTLib::exBarMoveStart,COleDateTime(2001,1,2,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1774 |
Is it possible to programmatically move all bars to start at specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarMoveStart,COleDateTime(2001,1,2,0,00,00).operator DATE()); spG2antt1->EndUpdate(); |
1773 |
Is it possible to programmatically move all bars of specified key
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<A*>",EXG2ANTTLib::exBarMove,long(2)); spG2antt1->EndUpdate(); |
1772 |
Is it possible to programmatically move all bars
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task A.1"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task A.2"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"A",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"B",vtMissing); var_Items->AddBar(var_Items->AddItem("Task B.2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"B",vtMissing); var_Items->PutItemBar(0,"<*>",EXG2ANTTLib::exBarMove,long(2)); spG2antt1->EndUpdate(); |
1771 |
How can I programmatically move a bar, so it ends at specified date (inclusive)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task 1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarMoveEndInclusive,COleDateTime(2001,1,4,0,00,00).operator DATE()); |
1770 |
How can I programmatically move a bar, so it ends at specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task 1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarMoveEnd,COleDateTime(2001,1,4,0,00,00).operator DATE()); |
1769 |
How can I programmatically move a bar, so it starts at specified date
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task 1"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"A",vtMissing); var_Items->PutItemBar(h,"A",EXG2ANTTLib::exBarMoveStart,COleDateTime(2001,1,4,0,00,00).operator DATE()); |
1768 |
I can’t figure out how to control the date and time format (in level 0, 1 and 2) when the user click on the OverviewZoom bottom
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutHeaderHeight(22); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2016,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutLevelCount(2); var_Chart->PutDrawLevelSeparator(EXG2ANTTLib::exLevelSolidLine); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowResizeChartMiddle | EXG2ANTTLib::exAllowResizeChartHeader)); var_Chart->PutMaxUnitWidth(196); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutAlignment(EXG2ANTTLib::AlignmentEnum(EXG2ANTTLib::exHOutside | EXG2ANTTLib::CenterAlignment)); var_Level->PutDrawTickLines(EXG2ANTTLib::exLevelSolidLine); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutDrawTickLines(EXG2ANTTLib::LevelLineEnum(EXG2ANTTLib::exLevelMiddleLine | EXG2ANTTLib::exLevelDotLine)); var_Level1->DrawTickLinesFrom(0,EXG2ANTTLib::exLevelSolidLine); var_Level1->PutBackColor(RGB(240,240,240)); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); var_Chart->PutAllowOverviewZoom(EXG2ANTTLib::exAlwaysZoom); var_Chart->PutUnitWidth(24); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); var_Chart->PutLabel(EXG2ANTTLib::exMinute,L""); var_Chart->PutLabel(EXG2ANTTLib::exHour,L""); var_Chart->PutLabel(EXG2ANTTLib::exWeek,L""); var_Chart->PutLabel(EXG2ANTTLib::exDay,_bstr_t("<font ;6><%d%><|><%d%><|><%d%> <fgcolor=A0A0A0><off -4><%d1%><|><%d%> <fgcolor=A0A0A0><off -4><%d2%><|><%d%> <fgcolor=A0A0A0><o") + "ff -4><%d3%><|><%d%> <fgcolor=A0A0A0><off -4><%dddd%><||><||>4096"); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->ScrollTo(var_Chart->GetFirstVisibleDate(),long(1)); spG2antt1->GetColumns()->Add(L"Default"); spG2antt1->EndUpdate(); |
1767 |
Can I use GroupBars with OverlaidType method
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); spG2antt1->PutDebug(VARIANT_TRUE); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->GetBars()->GetItem("Task")->PutOverlaidType(EXG2ANTTLib::exOverlaidBarsStack); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project"); var_Items->AddBar(h,"Summary",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,10,4,0,00,00).operator DATE(),vtMissing,vtMissing); long h1 = var_Items->InsertItem(h,vtMissing,"Tasks"); var_Items->AddBar(h1,"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,26,0,00,00).operator DATE(),"h1",vtMissing); _bstr_t h2 = h1; var_Items->AddBar(h2,"Task",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,9,30,0,00,00).operator DATE(),"h2",vtMissing); var_Items->AddLink("L1",h1,"h1",h2,"h2"); _bstr_t h3 = h1; var_Items->AddBar(h3,"Task",COleDateTime(2006,9,29,0,00,00).operator DATE(),COleDateTime(2006,10,4,0,00,00).operator DATE(),"h3",vtMissing); var_Items->AddLink("L2",h2,"h2",h3,"h3"); var_Items->DefineSummaryBars(h,"",h1,"h1"); var_Items->DefineSummaryBars(h,"",h2,"h2"); var_Items->DefineSummaryBars(h,"",h3,"h3"); var_Items->PutExpandItem(h,VARIANT_TRUE); var_Items->PutItemBold(h,VARIANT_TRUE); var_Items->GroupBars(h1,"h1",VARIANT_FALSE,h2,"h2",VARIANT_TRUE,long(31),"0;5;-1"); var_Items->GroupBars(h2,"h2",VARIANT_FALSE,h3,"h3",VARIANT_TRUE,long(31),"0;5;-1"); spG2antt1->EndUpdate(); |
1766 |
How do I change the link's lag so I can schedule bars to start later (with nonworking part)
// BarResizing event - Occurs when a bar is moving or resizing. void OnBarResizingG2antt1(long Item,VARIANT Key) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->SchedulePDM(Item,Key); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(22); spG2antt1->PutHeaderHeight(spG2antt1->GetDefaultItemHeight()); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLinksStyle(EXG2ANTTLib::exLinkSolid); var_Chart->PutLinksColor(RGB(128,128,128)); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,28,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar->PutColor(RGB(0,0,0)); var_Bar->PutStartColor(RGB(190,190,190)); var_Bar->PutEndColor(var_Bar->GetStartColor()); var_Bar->PutPattern(EXG2ANTTLib::exPatternBox); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1","FS lag=0 (default)"); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K2","FS lag=4"); var_Items->AddLink("L1",h1,"K1",h2,"K2"); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K3","FS lag=-1"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("L2",EXG2ANTTLib::exLinkPDMWorkingDelay,long(4)); long h4 = var_Items->AddItem("Task 4"); var_Items->AddBar(h4,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K4",vtMissing); var_Items->AddLink("L3",h3,"K3",h4,"K4"); var_Items->PutLink("L3",EXG2ANTTLib::exLinkPDMWorkingDelay,long(-1)); var_Items->SchedulePDM(0,"K1"); spG2antt1->EndUpdate(); |
1765 |
How do I change the link's lag so I can schedule bars to start later (without nonworking part)
// BarResizing event - Occurs when a bar is moving or resizing. void OnBarResizingG2antt1(long Item,VARIANT Key) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->SchedulePDM(Item,Key); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(22); spG2antt1->PutHeaderHeight(spG2antt1->GetDefaultItemHeight()); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); spG2antt1->PutAntiAliasing(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLinksStyle(EXG2ANTTLib::exLinkSolid); var_Chart->PutLinksColor(RGB(128,128,128)); var_Chart->PutLevelCount(2); var_Chart->PutNonworkingDays(0); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,28,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,48); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Bar->PutColor(RGB(0,0,0)); var_Bar->PutStartColor(RGB(190,190,190)); var_Bar->PutEndColor(var_Bar->GetStartColor()); var_Bar->PutPattern(EXG2ANTTLib::exPatternBox); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K1","FS lag=0 (default)"); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K2","FS lag=4"); var_Items->AddLink("L1",h1,"K1",h2,"K2"); long h3 = var_Items->AddItem("Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K3","FS lag=-1"); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("L2",EXG2ANTTLib::exLinkPDMDelay,long(4)); long h4 = var_Items->AddItem("Task 4"); var_Items->AddBar(h4,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"K4",vtMissing); var_Items->AddLink("L3",h3,"K3",h4,"K4"); var_Items->PutLink("L3",EXG2ANTTLib::exLinkPDMDelay,long(-1)); var_Items->SchedulePDM(0,"K1"); spG2antt1->EndUpdate(); |
1764 |
Is it possible to select the entire row/line, when user clicks the first column, and select individually the rest of cells, while user clicks any other column
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // MouseDown event - Occurs when the user presses a mouse button. void OnMouseDownG2antt1(short Button,short Shift,long X,long Y) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long i = spG2antt1->GetItemFromPoint(-1,-1,c,hit); spG2antt1->PutFullRowSelect(spG2antt1->GetColumns()->GetItem(c)->GetData()); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutHeaderHeight(22); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Flat); spG2antt1->PutBackColorLock(RGB(240,240,240)); spG2antt1->PutBackColorHeader(spG2antt1->GetBackColorLock()); spG2antt1->PutHasLines(EXG2ANTTLib::exNoLine); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutSortBarVisible(VARIANT_FALSE); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->PutReadOnly(EXG2ANTTLib::exReadOnly); spG2antt1->PutShowFocusRect(VARIANT_FALSE); spG2antt1->PutCountLockedColumns(1); spG2antt1->PutAutoDrag(EXG2ANTTLib::exAutoDragScroll); spG2antt1->PutSingleSort(VARIANT_FALSE); spG2antt1->PutColumnsAllowSizing(VARIANT_TRUE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutGridLineStyle(EXG2ANTTLib::exGridLinesSolid); spG2antt1->PutGridLineColor(RGB(220,220,220)); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutLevelCount(2); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,256); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetColumns()->GetItem(long(0))->PutData(long(-1)); spG2antt1->PutLayout(L"singlesort=\"C5:1\";multiplesort=\" C1:2\""); spG2antt1->EndUpdate(); |
1763 |
I've also hit a strange problem with the BeforeExpandItem event - the Cancel parameter is declared as const in Delphi when I believe it should be declared as var or out so I can use it to return OleVariant(True) to cancel the operation, or am I missing something, or how can I disable expanding / collapsing the items
// BeforeExpandItem event - Fired before an item is about to be expanded (collapsed). void OnBeforeExpandItemG2antt1(long Item,VARIANT FAR* Cancel) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->PutEventParam(1,VARIANT_TRUE); } // Event event - Notifies the application once the control fires an event. void OnEventG2antt1(long EventID) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( _bstr_t(spG2antt1->GetEventParam(-2)) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root A"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root B"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1762 |
Is there any way I can get rid / hide of the vertical blue lines ( today, selected date )
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutMarkSelectDateColor(var_Chart->GetBackColor()); var_Chart->PutMarkTodayColor(var_Chart->GetBackColor()); spG2antt1->EndUpdate(); |
1761 |
Is it possible to search for a bar through items only ( not including the locked items )
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2015,12,31,0,00,00).operator DATE()); spG2antt1->PutBackColorAlternate(RGB(250,250,250)); spG2antt1->PutShowLockedItems(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Find"))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutFormatColumn(L"int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` "); spG2antt1->GetChart()->PutColumnsFormatLevel(L"1"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutLockedItemCount(EXG2ANTTLib::exTop,3); long h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,0); var_Items->PutCellValue(h,long(0),"locked-top 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T1",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,1); var_Items->PutCellValue(h,long(0),"locked-top 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T2",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,2); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); var_Items->AddBar(var_Items->AddItem("un-locked item 1"),"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T3",vtMissing); var_Items->AddBar(var_Items->AddItem("un-locked item 2"),"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T4",vtMissing); var_Items->PutLockedItemCount(EXG2ANTTLib::exMiddle,3); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,0); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,1); var_Items->PutCellValue(h,long(0),"locked-bottom 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T5",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,2); var_Items->PutCellValue(h,long(0),"locked-bottom 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T6",vtMissing); EXG2ANTTLib::IItemsPtr var_Items1 = spG2antt1->GetItems(); h = var_Items1->GetFindBar("T4",long(0)); var_Items1->PutItemBar(h,var_Items1->GetFirstItemBar(h),EXG2ANTTLib::exBarColor,long(255)); var_Items1->PutCellValue(h,long(1),h); spG2antt1->EndUpdate(); |
1760 |
Is it possible to search for a bar through bottom-locked-items only
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2015,12,31,0,00,00).operator DATE()); spG2antt1->PutBackColorAlternate(RGB(250,250,250)); spG2antt1->PutShowLockedItems(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Find"))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutFormatColumn(L"int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` "); spG2antt1->GetChart()->PutColumnsFormatLevel(L"1"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutLockedItemCount(EXG2ANTTLib::exTop,3); long h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,0); var_Items->PutCellValue(h,long(0),"locked-top 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T1",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,1); var_Items->PutCellValue(h,long(0),"locked-top 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T2",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,2); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); var_Items->AddBar(var_Items->AddItem("un-locked item 1"),"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T3",vtMissing); var_Items->AddBar(var_Items->AddItem("un-locked item 2"),"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T4",vtMissing); var_Items->PutLockedItemCount(EXG2ANTTLib::exMiddle,3); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,0); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,1); var_Items->PutCellValue(h,long(0),"locked-bottom 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T5",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,2); var_Items->PutCellValue(h,long(0),"locked-bottom 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T6",vtMissing); EXG2ANTTLib::IItemsPtr var_Items1 = spG2antt1->GetItems(); h = var_Items1->GetFindBar("T6",long(-4)); var_Items1->PutItemBar(h,var_Items1->GetFirstItemBar(h),EXG2ANTTLib::exBarColor,long(255)); var_Items1->PutCellValue(h,long(1),h); spG2antt1->EndUpdate(); |
1759 |
Is it possible to search for a bar through top-locked-items only
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2015,12,31,0,00,00).operator DATE()); spG2antt1->PutBackColorAlternate(RGB(250,250,250)); spG2antt1->PutShowLockedItems(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Find"))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutFormatColumn(L"int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` "); spG2antt1->GetChart()->PutColumnsFormatLevel(L"1"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutLockedItemCount(EXG2ANTTLib::exTop,3); long h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,0); var_Items->PutCellValue(h,long(0),"locked-top 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T1",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,1); var_Items->PutCellValue(h,long(0),"locked-top 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T2",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,2); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); var_Items->AddBar(var_Items->AddItem("un-locked item 1"),"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T3",vtMissing); var_Items->AddBar(var_Items->AddItem("un-locked item 2"),"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T4",vtMissing); var_Items->PutLockedItemCount(EXG2ANTTLib::exMiddle,3); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,0); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,1); var_Items->PutCellValue(h,long(0),"locked-bottom 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T5",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,2); var_Items->PutCellValue(h,long(0),"locked-bottom 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T6",vtMissing); EXG2ANTTLib::IItemsPtr var_Items1 = spG2antt1->GetItems(); h = var_Items1->GetFindBar("T1",long(-3)); var_Items1->PutItemBar(h,var_Items1->GetFirstItemBar(h),EXG2ANTTLib::exBarColor,long(255)); var_Items1->PutCellValue(h,long(1),h); spG2antt1->EndUpdate(); |
1758 |
Is it possible to search for a bar through all locked-items only
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2015,12,31,0,00,00).operator DATE()); spG2antt1->PutBackColorAlternate(RGB(250,250,250)); spG2antt1->PutShowLockedItems(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Find"))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutFormatColumn(L"int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` "); spG2antt1->GetChart()->PutColumnsFormatLevel(L"1"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutLockedItemCount(EXG2ANTTLib::exTop,3); long h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,0); var_Items->PutCellValue(h,long(0),"locked-top 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T1",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,1); var_Items->PutCellValue(h,long(0),"locked-top 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T2",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,2); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); var_Items->AddBar(var_Items->AddItem("un-locked item 1"),"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T3",vtMissing); var_Items->AddBar(var_Items->AddItem("un-locked item 2"),"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T4",vtMissing); var_Items->PutLockedItemCount(EXG2ANTTLib::exMiddle,3); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,0); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,1); var_Items->PutCellValue(h,long(0),"locked-bottom 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T5",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,2); var_Items->PutCellValue(h,long(0),"locked-bottom 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T6",vtMissing); EXG2ANTTLib::IItemsPtr var_Items1 = spG2antt1->GetItems(); h = var_Items1->GetFindBar("T2",long(-2)); var_Items1->PutItemBar(h,var_Items1->GetFirstItemBar(h),EXG2ANTTLib::exBarColor,long(255)); var_Items1->PutCellValue(h,long(1),h); spG2antt1->EndUpdate(); |
1757 |
Is it possible to search for a bar through all items ( including locked items )
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDebug(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(COleDateTime(2015,12,31,0,00,00).operator DATE()); spG2antt1->PutBackColorAlternate(RGB(250,250,250)); spG2antt1->PutShowLockedItems(VARIANT_TRUE); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Find"))); var_Column->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutFormatColumn(L"int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` "); spG2antt1->GetChart()->PutColumnsFormatLevel(L"1"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutLockedItemCount(EXG2ANTTLib::exTop,3); long h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,0); var_Items->PutCellValue(h,long(0),"locked-top 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T1",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,1); var_Items->PutCellValue(h,long(0),"locked-top 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T2",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exTop,2); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); var_Items->AddBar(var_Items->AddItem("un-locked item 1"),"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T3",vtMissing); var_Items->AddBar(var_Items->AddItem("un-locked item 2"),"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T4",vtMissing); var_Items->PutLockedItemCount(EXG2ANTTLib::exMiddle,3); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,0); var_Items->PutSelectItem(h,VARIANT_FALSE); var_Items->PutItemDivider(h,0); var_Items->PutItemHeight(h,2); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,1); var_Items->PutCellValue(h,long(0),"locked-bottom 1"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,4,0,00,00).operator DATE(),COleDateTime(2016,1,8,0,00,00).operator DATE(),"T5",vtMissing); h = var_Items->GetLockedItem(EXG2ANTTLib::exMiddle,2); var_Items->PutCellValue(h,long(0),"locked-bottom 2"); var_Items->AddBar(h,"Task",COleDateTime(2016,1,5,0,00,00).operator DATE(),COleDateTime(2016,1,9,0,00,00).operator DATE(),"T6",vtMissing); EXG2ANTTLib::IItemsPtr var_Items1 = spG2antt1->GetItems(); h = var_Items1->GetFindBar("T5",long(-1)); var_Items1->PutItemBar(h,var_Items1->GetFirstItemBar(h),EXG2ANTTLib::exBarColor,long(255)); var_Items1->PutCellValue(h,long(1),h); spG2antt1->EndUpdate(); |
1756 |
How do I clip/hide/align the bar's caption/text based on the bar's size/width/length
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Clip"); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowResizeChartMiddle | EXG2ANTTLib::exAllowResizeChartHeader)); var_Chart->PutDrawGridLines(EXG2ANTTLib::exRowLines); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,23,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,216); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutPattern(EXG2ANTTLib::exPatternBox); var_Bar->PutColor(RGB(164,164,164)); var_Bar->PutStartColor(RGB(240,240,240)); var_Bar->PutEndColor(var_Bar->GetStartColor()); var_Bar->PutOverlaidType(EXG2ANTTLib::OverlaidBarsTypeEnum(EXG2ANTTLib::exOverlaidBarsIncludeCaption | EXG2ANTTLib::exOverlaidBarsStackAutoArrange | EXG2ANTTLib::exOverlaidBarsStack)); var_Bar->PutHeight(15); var_Chart->PutMinUnitWidth(var_Chart->GetUnitWidth()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("no clip, (0-2)"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1","no clip, right(<b>2</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(2)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K2","no clip, center(<b>1</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(1)); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K3","no clip, left(<b>0</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarHAlignCaption,long(0)); h = var_Items->AddItem("clip, inside (3-5)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1","clip, inside, right(<b>5</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(5)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2","clip, inside, center(<b>4</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(4)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K3","clip, inside, left(<b>3</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarHAlignCaption,long(3)); h = var_Items->AddItem("hide on min width, clip if not fit, inside (6-8)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,26,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K1","hide on min width, clip if not fit, inside, right(<b>8</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(8)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,26,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K2","hide on min width, clip if not fit, inside, center(<b>7</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(7)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,26,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K3","hide on min width, clip if not fit, inside, left(<b>6</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarHAlignCaption,long(6)); h = var_Items->AddItem("hide if not fit, no clip, inside (9-11)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1","hide if not fit, no clip, inside, right(<b>11</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(11)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2","hide if not fit, no clip, center(<b>10</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(10)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K3","hide if not fit, no clip, inside, left(<b>9</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarHAlignCaption,long(9)); h = var_Items->AddItem("no clip, inside, outside (12-14)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K1","no clip, inside, outside, right(<b>14</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(14)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K2","no clip, inside, outside, center(<b>13</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(13)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,28,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"K3","no clip, inside, outside, left(<b>12</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarHAlignCaption,long(12)); h = var_Items->AddItem("no clip, outside (16-18)"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,30,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K1","no clip, outside, right(<b>18</b>)"); var_Items->PutItemBar(h,"K1",EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,30,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K2","no clip, outside, center(<b>17</b>)"); var_Items->PutItemBar(h,"K2",EXG2ANTTLib::exBarHAlignCaption,long(17)); var_Items->AddBar(h,"Task",COleDateTime(2000,12,30,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"K3","no clip, outside, left(<b>16</b>)"); var_Items->PutItemBar(h,"K3",EXG2ANTTLib::exBarHAlignCaption,long(16)); spG2antt1->EndUpdate(); |
1755 |
Is there a way to prevent the automatic horizontal scrolling of the chart when moving or resizing a bar (method 2)
// DateChange event - Occurs when the first visible date is changed. void OnDateChangeG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,2,0,00,00).operator DATE()); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutAlignment(EXG2ANTTLib::LeftAlignment); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutVisible(VARIANT_FALSE); var_Column1->PutAlignment(EXG2ANTTLib::RightAlignment); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,2,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutColumnsFormatLevel(L"1[bg=12500670]:52,|,2[bg=12500670]:52"); var_Chart->PutColumnsTransparent(50); var_Chart->PutScrollBar(VARIANT_FALSE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1754 |
Is there a way to prevent the automatic horizontal scrolling of the chart when moving or resizing a bar, including limiting the bars
// BarResizing event - Occurs when a bar is moving or resizing. void OnBarResizingG2antt1(long Item,VARIANT Key) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemBar(Item,Key,EXG2ANTTLib::exBarMinStart,COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Items->PutItemBar(Item,Key,EXG2ANTTLib::exBarMaxEnd,COleDateTime(2001,2,1,0,00,00).operator DATE()); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutAlignment(EXG2ANTTLib::LeftAlignment); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutVisible(VARIANT_FALSE); var_Column1->PutAlignment(EXG2ANTTLib::RightAlignment); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,2,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutColumnsFormatLevel(L"1[bg=12500670]:52,|,2[bg=12500670]:52"); var_Chart->PutColumnsTransparent(50); var_Chart->PutScrollRange(EXG2ANTTLib::exStartDate,COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutScrollRange(EXG2ANTTLib::exEndDate,COleDateTime(2001,1,31,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1753 |
Is there a way to prevent the automatic horizontal scrolling of the chart when moving or resizing a bar (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutAlignment(EXG2ANTTLib::LeftAlignment); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutVisible(VARIANT_FALSE); var_Column1->PutAlignment(EXG2ANTTLib::RightAlignment); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,2,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutColumnsFormatLevel(L"1[bg=12500670]:52,|,2[bg=12500670]:52"); var_Chart->PutColumnsTransparent(50); var_Chart->PutScrollRange(EXG2ANTTLib::exStartDate,COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutScrollRange(EXG2ANTTLib::exEndDate,COleDateTime(2001,1,31,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1752 |
Is it possible to have "Preview Window" as a "Modal Window or 'always-on-top window'"
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->AddItem("Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->PutLink("L1",EXG2ANTTLib::exLinkStartPos,long(0)); spG2antt1->EndUpdate(); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'EXPRINTLib' for the library: 'ExPrint 1.0 Control Library' #import <ExPrint.dll> using namespace EXPRINTLib; */ EXPRINTLib::IExPrintPtr var_Print = ::CreateObject(L"Exontrol.Print"); OutputDebugStringW( var_Print->GetVersion() ); var_Print->PutForeground(-1); var_Print->PutPrintExt(((EXG2ANTTLib::IG2anttPtr)(spG2antt1))); var_Print->Preview(); |
1751 |
The week number is not correct (wrong). What can I do
|
1750 |
When the user zooms with the mouse, the chart automatically switches the unit scale - ideally I'd like to replicate this so I can switch the unitscale at the same "zoom levels" that the mouse zooming does - is this possible
// ChartEndChanging event - Occurs after the chart has been changed. void OnChartEndChangingG2antt1(long Operation) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); OutputDebugStringW( L"FirstVisibleDate" ); OutputDebugStringW( _bstr_t(var_Chart->GetFirstVisibleDate()) ); OutputDebugStringW( L"UnitScale" ); OutputDebugStringW( _bstr_t(var_Chart->GetUnitScale()) ); OutputDebugStringW( L"UnitWidth" ); OutputDebugStringW( _bstr_t(var_Chart->GetUnitWidth()) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(3); var_Chart->PutAllowResizeChart(EXG2ANTTLib::ResizeChartEnum(EXG2ANTTLib::exAllowChangeUnitScale | EXG2ANTTLib::exAllowResizeChartMiddle | EXG2ANTTLib::exAllowResizeChartHeader)); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutMarkTodayColor(var_Chart->GetBackColor()); spG2antt1->EndUpdate(); |
1749 |
The first week number is not correctly assigned. What can I do
|
1748 |
How can I display the +/- expand - collapse buttons, a bit larger
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(3,"c:\\exontrol\\images\\normal.ebn"); var_Appearance->Add(4,"c:\\exontrol\\images\\pushed.ebn"); var_Appearance->Add(1,"CP:3 -4 -4 4 4"); var_Appearance->Add(2,"CP:4 -4 -4 4 4"); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exGroupLinesAtRoot); spG2antt1->PutHasButtons(EXG2ANTTLib::exCustom); spG2antt1->PutHasButtonsCustom(VARIANT_FALSE,16777216); spG2antt1->PutHasButtonsCustom(VARIANT_TRUE,33554432); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child"); spG2antt1->EndUpdate(); |
1747 |
Is there any option to control where I can drop the items when using the AutoDrag property
// AllowAutoDrag event - Occurs when the user drags the item between InsertA and InsertB as child of NewParent. void OnAllowAutoDragG2antt1(long Item,long NewParent,long InsertA,long InsertB,BOOL FAR* Cancel) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); OutputDebugStringW( L"NewParent" ); OutputDebugStringW( var_Items->GetCellCaption(NewParent,long(0)) ); OutputDebugStringW( L"After" ); OutputDebugStringW( var_Items->GetCellCaption(InsertA,long(0)) ); OutputDebugStringW( L"Before" ); OutputDebugStringW( var_Items->GetCellCaption(InsertB,long(0)) ); Cancel = VARIANT_TRUE; } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAutoDrag(EXG2ANTTLib::exAutoDragPositionAny); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exNoLinesAtRoot); spG2antt1->PutHasLines(EXG2ANTTLib::exThinLine); spG2antt1->PutShowFocusRect(VARIANT_FALSE); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutShowNonworkingDates(VARIANT_FALSE); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,29,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->PutLevelCount(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Group 1"); var_Items->PutItemDivider(h,0); var_Items->PutItemBold(h,VARIANT_TRUE); long h1 = var_Items->InsertItem(h,vtMissing,"Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,4,0,00,00).operator DATE(),"K1",vtMissing); long h2 = var_Items->InsertItem(h,vtMissing,"Task 2"); var_Items->AddBar(h2,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"K2",vtMissing); var_Items->AddLink("L1",h1,"K1",h2,"K2"); var_Items->PutLink("L1",EXG2ANTTLib::exLinkText,"L1"); long h3 = var_Items->InsertItem(h,vtMissing,"Task 3"); var_Items->AddBar(h3,"Task",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),"K3",vtMissing); var_Items->AddLink("L2",h2,"K2",h3,"K3"); var_Items->PutLink("L2",EXG2ANTTLib::exLinkText,"L2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Group 2"); var_Items->PutItemBold(h,VARIANT_TRUE); var_Items->PutItemDivider(h,0); spG2antt1->EndUpdate(); |
1746 |
The column (chart section ) overlaps the bars, when using the ColumnsFormatLevel property. How can I prevent that
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutAlignment(EXG2ANTTLib::LeftAlignment); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutVisible(VARIANT_FALSE); var_Column1->PutAlignment(EXG2ANTTLib::RightAlignment); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,2,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutColumnsFormatLevel(L"1[bg=12500670]:52,|,2[bg=12500670]:52"); var_Chart->PutColumnsTransparent(50); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1745 |
How do I show the column ( chart section ) with a different background color, when using the ColumnsFormatLevel property (method 2)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutAlignment(EXG2ANTTLib::LeftAlignment); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutVisible(VARIANT_FALSE); var_Column1->PutAlignment(EXG2ANTTLib::RightAlignment); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,2,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutColumnsFormatLevel(L"1[bg=12500670]:52,|,2[bg=12500670]:52"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1744 |
How do I show the column ( chart section ) with a different background color, when using the ColumnsFormatLevel property (method 1)
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutVisible(VARIANT_FALSE); var_Column->PutAlignment(EXG2ANTTLib::LeftAlignment); var_Column->PutDef(EXG2ANTTLib::exCellBackColor,long(12500670)); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutVisible(VARIANT_FALSE); var_Column1->PutAlignment(EXG2ANTTLib::RightAlignment); var_Column1->PutDef(EXG2ANTTLib::exCellBackColor,long(12500670)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,31,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,48); var_Chart->PutColumnsFormatLevel(L"1:52,|,2:52"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1743 |
How can I display the control's content on an single A3 paper size, when using PDF format
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutAntiAliasing(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,24,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutPattern(EXG2ANTTLib::exPatternSolid); var_Bar->PutColor(RGB(0,0,0)); var_Bar->PutHeight(16); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task 1"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,25,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"1","<fgcolor=FFFFFF>Center"); var_Items->PutItemBar(h,"1",EXG2ANTTLib::exBarExtraCaption,"left"); var_Items->PutItemBar(h,"1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(16)); h = var_Items->AddItem("Task 2"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),"1","<fgcolor=FFFFFF>Center"); h = var_Items->AddItem("Task 3"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,16,0,00,00).operator DATE(),COleDateTime(2001,1,26,0,00,00).operator DATE(),"2","Center"); var_Items->PutItemBar(h,"2",EXG2ANTTLib::exBarExtraCaption,"right"); var_Items->PutItemBar(h,"2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(18)); EXG2ANTTLib::INotesPtr var_Notes = spG2antt1->GetChart()->GetNotes(); EXG2ANTTLib::INotePtr var_Note = var_Notes->Add("1S",spG2antt1->GetItems()->GetItemByIndex(1),"1",L"<%m3%>-<%d%>"); var_Note->PutPartShadow(EXG2ANTTLib::exNoteEnd,VARIANT_FALSE); var_Note->PutPartHOffset(EXG2ANTTLib::exNoteEnd,-16); var_Note->PutPartVOffset(EXG2ANTTLib::exNoteEnd,4); EXG2ANTTLib::INotePtr var_Note1 = var_Notes->Add("1F",spG2antt1->GetItems()->GetItemByIndex(1),"1",L"<%m3%>-<%d%>"); var_Note1->PutRelativePosition(long(1)); var_Note1->PutPartShadow(EXG2ANTTLib::exNoteEnd,VARIANT_FALSE); var_Note1->PutPartHOffset(EXG2ANTTLib::exNoteEnd,16); var_Note1->PutPartVOffset(EXG2ANTTLib::exNoteEnd,-4); _variant_t var_CopyTo = spG2antt1->GetCopyTo(L"C:\\Temp\\Preview.pdf|11.69 in x 16.53 in||single"); OutputDebugStringW( L"Look for C:\\Temp\\Preview.pd file." ); spG2antt1->EndUpdate(); |
1742 |
How can I display the control's content on an A3 paper size, when using PDF format
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Task"); spG2antt1->PutAntiAliasing(VARIANT_TRUE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2000,12,24,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->PutLevelCount(2); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutPattern(EXG2ANTTLib::exPatternSolid); var_Bar->PutColor(RGB(0,0,0)); var_Bar->PutHeight(16); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task 1"); var_Items->AddBar(h,"Task",COleDateTime(2000,12,25,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),"1","<fgcolor=FFFFFF>Center"); var_Items->PutItemBar(h,"1",EXG2ANTTLib::exBarExtraCaption,"left"); var_Items->PutItemBar(h,"1",EXG2ANTTLib::exBarExtraCaptionHAlign,long(16)); h = var_Items->AddItem("Task 2"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,5,0,00,00).operator DATE(),COleDateTime(2001,1,16,0,00,00).operator DATE(),"1","<fgcolor=FFFFFF>Center"); h = var_Items->AddItem("Task 3"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,16,0,00,00).operator DATE(),COleDateTime(2001,1,26,0,00,00).operator DATE(),"2","Center"); var_Items->PutItemBar(h,"2",EXG2ANTTLib::exBarExtraCaption,"right"); var_Items->PutItemBar(h,"2",EXG2ANTTLib::exBarExtraCaptionHAlign,long(18)); EXG2ANTTLib::INotesPtr var_Notes = spG2antt1->GetChart()->GetNotes(); EXG2ANTTLib::INotePtr var_Note = var_Notes->Add("1S",spG2antt1->GetItems()->GetItemByIndex(1),"1",L"<%m3%>-<%d%>"); var_Note->PutPartShadow(EXG2ANTTLib::exNoteEnd,VARIANT_FALSE); var_Note->PutPartHOffset(EXG2ANTTLib::exNoteEnd,-16); var_Note->PutPartVOffset(EXG2ANTTLib::exNoteEnd,4); EXG2ANTTLib::INotePtr var_Note1 = var_Notes->Add("1F",spG2antt1->GetItems()->GetItemByIndex(1),"1",L"<%m3%>-<%d%>"); var_Note1->PutRelativePosition(long(1)); var_Note1->PutPartShadow(EXG2ANTTLib::exNoteEnd,VARIANT_FALSE); var_Note1->PutPartHOffset(EXG2ANTTLib::exNoteEnd,16); var_Note1->PutPartVOffset(EXG2ANTTLib::exNoteEnd,-4); _variant_t var_CopyTo = spG2antt1->GetCopyTo(L"C:\\Temp\\Preview.pdf|11.69 in x 16.53 in"); OutputDebugStringW( L"Look for C:\\Temp\\Preview.pd file." ); spG2antt1->EndUpdate(); |
1741 |
How can I specify the grouping strategy, ie numbers from 1 to 5 are given the value (1-5) and grouping is done on this new value
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemBold(Item,VARIANT_TRUE); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(1)),var_Items->GetCellValue(Item,long(2)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutAllowGroupBy(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutAllowGroupBy(VARIANT_FALSE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,256); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("1"),"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,27,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("1"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("2"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("2"),"Task",COleDateTime(2006,9,23,0,00,00).operator DATE(),COleDateTime(2006,9,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("3"),"Task",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,9,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("3"),"Task",COleDateTime(2006,9,26,0,00,00).operator DATE(),COleDateTime(2006,9,30,0,00,00).operator DATE(),vtMissing,vtMissing); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Tasks - Group"))); var_Column2->PutVisible(VARIANT_FALSE); var_Column2->PutFormatColumn(L"%0 in (1,2) ? `1 - 2` : `3 -`"); var_Column2->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); |
1740 |
How can I filter the chart and its content, not the items section
// RClick event - Fired when right mouse button is clicked void OnRClickG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetColumns()->GetItem("Start")->ShowFilter("-1,-1,128,128"); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutDisplayFilterDate(VARIANT_TRUE); var_Column->PutDisplayFilterPattern(VARIANT_FALSE); var_Column->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowExclude | EXG2ANTTLib::exShowCheckBox)); var_Column->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutDisplayFilterDate(VARIANT_TRUE); var_Column1->PutDisplayFilterPattern(VARIANT_FALSE); var_Column1->PutVisible(VARIANT_FALSE); var_Column1->PutFilterList(EXG2ANTTLib::FilterListEnum(EXG2ANTTLib::exShowExclude | EXG2ANTTLib::exShowCheckBox)); var_Column1->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,128); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,27,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 4"),"Task",COleDateTime(2006,9,23,0,00,00).operator DATE(),COleDateTime(2006,9,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 5"),"Task",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,9,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 6"),"Task",COleDateTime(2006,9,26,0,00,00).operator DATE(),COleDateTime(2006,9,30,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1739 |
How do I enable the Group-By feature
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemBackColor(Item,RGB(240,240,240)); spG2antt1->GetChart()->PutItemBackColor(Item,RGB(240,240,240)); var_Items->PutItemDividerLine(Item,EXG2ANTTLib::EmptyLine); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(1)),var_Items->GetCellValue(Item,long(2)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->PutAllowGroupBy(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->PutAllowGroupBy(VARIANT_FALSE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,256); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,27,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,28,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2006,9,23,0,00,00).operator DATE(),COleDateTime(2006,9,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2006,9,25,0,00,00).operator DATE(),COleDateTime(2006,9,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2006,9,26,0,00,00).operator DATE(),COleDateTime(2006,9,30,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->GetColumns()->GetItem(long(0))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); |
1738 |
Is there any method to know number/length/count/duration of working days in a bar ( excluding non-working days)
// SelectionChanged event - Fired after a new item has been selected. void OnSelectionChangedG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); OutputDebugStringW( var_Items->GetCellCaption(var_Items->GetFocusItem(),long(0)) ); OutputDebugStringW( _bstr_t(var_Items->GetItemBar(var_Items->GetFocusItem(),"",EXG2ANTTLib::exBarWorkingCount)) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutSelBackColor(RGB(142,190,255)); spG2antt1->PutSelForeColor(RGB(0,0,0)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->PutFirstVisibleDate(COleDateTime(2002,1,1,0,00,00).operator DATE()); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->Add(L"Task:Split"); var_Bar->PutShortcut(L"Task"); var_Bar->PutDef(EXG2ANTTLib::exBarCaption,"<%=%258%><font ;6><off 3>w/units"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); var_Chart->PutSelBackColor(spG2antt1->GetSelBackColor()); spG2antt1->GetColumns()->Add(L"Task"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task A"); var_Items->AddBar(h,"Task",COleDateTime(2002,1,2,0,00,00).operator DATE(),COleDateTime(2002,1,9,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem("Task B"); var_Items->AddBar(h,"Task",COleDateTime(2002,1,3,0,00,00).operator DATE(),COleDateTime(2002,1,8,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutSelectItem(h,VARIANT_TRUE); h = var_Items->AddItem("Task C"); var_Items->AddBar(h,"Task",COleDateTime(2002,1,4,0,00,00).operator DATE(),COleDateTime(2002,1,5,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1737 |
How do i verify weather specified unit is Nonworking Working Unit
// MouseMove event - Occurs when the user moves the mouse. void OnMouseMoveG2antt1(short Button,short Shift,long X,long Y) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); long h = spG2antt1->GetItemFromPoint(-1,-1,c,hit); Date d = spG2antt1->GetChart()->GetDateFromPoint(-1,-1); OutputDebugStringW( L"d" ); OutputDebugStringW( _bstr_t(spG2antt1->GetChart()->GetIsNonworkingDate(d,h)) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"NonWorking"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstWeekDay(EXG2ANTTLib::exMonday); var_Chart->PutFirstVisibleDate(COleDateTime(2008,1,24,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); var_Chart->PutLevelCount(2); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Default"); h = var_Items->AddItem("January"); var_Items->PutItemNonworkingUnits(h,VARIANT_FALSE,L"month(value) = 1"); h = var_Items->AddItem("February, Saturday, Sunday"); var_Items->PutItemNonworkingUnits(h,VARIANT_FALSE,L"month(value) = 2 or (weekday(value) = 0 or weekday(value) = 6)"); h = var_Items->AddItem("Sunday"); var_Items->PutItemNonworkingUnits(h,VARIANT_FALSE,L"weekday(value) = 0"); spG2antt1->EndUpdate(); |
1736 |
How can I specify the bar's caption to be caption from a column/cell
// Change event - Occurs when the user changes the cell's content. void OnChangeG2antt1(long Item,long ColIndex,VARIANT FAR* NewValue) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutDef(EXG2ANTTLib::exBarCaption,"<fgcolor=808080><%=%C0%>"); var_Bar->PutDef(EXG2ANTTLib::exBarHAlignCaption,long(18)); EXG2ANTTLib::IEditorPtr var_Editor = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Task")))->GetEditor(); var_Editor->PutEditType(EXG2ANTTLib::DropDownListType); var_Editor->AddItem(1,L"Aka",vtMissing); var_Editor->AddItem(2,L"Baka",vtMissing); var_Editor->AddItem(3,L"Taka",vtMissing); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem(long(1)),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem(long(2)),"Task",COleDateTime(2001,1,3,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem(long(3)),"Task",COleDateTime(2001,1,4,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1735 |
The histogram values displayed on the chart are using 2 decimal places. Can this be formated to just 0 decimal place, so 86.79% becomes 87%
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Effort"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(21)); var_Column->GetEditor()->PutEditType(EXG2ANTTLib::SpinType); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutLevelCount(2); var_Chart->PutNonworkingDays(0); var_Chart->PutPaneWidth(VARIANT_FALSE,96); var_Chart->PutFirstVisibleDate(COleDateTime(2005,6,20,0,00,00).operator DATE()); var_Chart->PutHistogramVisible(VARIANT_TRUE); var_Chart->PutHistogramHeight(128); var_Chart->PutHistogramView(EXG2ANTTLib::exHistogramAllItems); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHistogramPattern(var_Bar->GetPattern()); var_Bar->PutHistogramType(EXG2ANTTLib::exHistOverload); var_Bar->PutHistogramCriticalValue(3); var_Bar->PutShowHistogramValues(L"value>3?255:1"); var_Bar->PutHistogramItems(-11); var_Bar->PutHistogramGridLinesColor(RGB(192,192,192)); var_Bar->PutHistogramRulerLinesColor(RGB(0,0,1)); var_Bar->PutFormatHistogramValues(L"(value format `0`) + ` units`"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); long h1 = var_Items->AddItem("Task 1"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,21,0,00,00).operator DATE(),COleDateTime(2005,6,23,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),double(6.79)); h1 = var_Items->AddItem("Task 2"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,24,0,00,00).operator DATE(),COleDateTime(2005,6,26,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),double(3.19)); h1 = var_Items->AddItem("Task 3"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,27,0,00,00).operator DATE(),COleDateTime(2005,6,29,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),long(2)); h1 = var_Items->AddItem("Task 4"); var_Items->AddBar(h1,"Task",COleDateTime(2005,6,30,0,00,00).operator DATE(),COleDateTime(2005,7,2,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutCellValue(h1,long(1),long(1)); spG2antt1->EndUpdate(); |
1734 |
How can I create a relative time-scale
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(24); spG2antt1->PutHeaderHeight(spG2antt1->GetDefaultItemHeight()); spG2antt1->PutGridLineStyle(EXG2ANTTLib::exGridLinesSolid); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exNoLinesAtRoot); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutDrawGridLines(EXG2ANTTLib::exAllLines); var_Chart->PutGridLineStyle(EXG2ANTTLib::exGridLinesSolid); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutFirstVisibleDate(long(0)); var_Chart->PutNonworkingDays(0); var_Chart->PutUnitWidth(36); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutUnit(EXG2ANTTLib::exDay); var_Level->PutCount(6); var_Level->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Level->PutLabel("<%i%>"); var_Level->PutFormatLabel(L"'<b>' + ( (value / 6) array ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec') ) + '-16'"); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutLabel("<%i%>"); var_Level1->PutFormatLabel(L"1 + value mod 6 + ` `"); var_Level1->PutAlignment(EXG2ANTTLib::RightAlignment); var_Chart->PutAdjustLevelsToBase(VARIANT_TRUE); var_Chart->PutScrollRange(EXG2ANTTLib::exStartDate,long(0)); var_Chart->PutScrollRange(EXG2ANTTLib::exEndDate,long(95)); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHeight(15); var_Bar->PutColor(RGB(252,213,180)); var_Bar->PutPattern(EXG2ANTTLib::exPatternSolid); var_Bar->PutDef(EXG2ANTTLib::exBarCaption,"date blocking"); spG2antt1->GetColumns()->Add(L"Company"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("ABC Company"); var_Items->PutItemBackColor(h,RGB(240,240,240)); spG2antt1->GetChart()->PutItemBackColor(h,RGB(240,240,240)); long hChild = var_Items->InsertItem(h,vtMissing,"line 1"); var_Items->AddBar(hChild,"Task",long(0),long(3),vtMissing,vtMissing); hChild = var_Items->InsertItem(h,vtMissing,"line 2"); var_Items->AddBar(hChild,"Task",long(3),long(5),"A",vtMissing); var_Items->AddBar(hChild,"Task",long(7),long(10),"B",vtMissing); hChild = var_Items->InsertItem(h,vtMissing,"line 3"); var_Items->AddBar(hChild,"Task",long(5),long(8),"A",vtMissing); var_Items->AddBar(hChild,"Task",long(9),long(12),"B",vtMissing); var_Items->PutExpandItem(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1733 |
Extending the bar's visual appearance with additional objects, EBNs, using the exBarBackgroundExt and exBarBackgroundExtInflate
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutDefaultItemHeight(32); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAADhABcMIQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYE") + "DGHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NwXFaNZznBK7LpvK5HNrie55XzAcj3dbmAYJQzB" + "JLxKSIDwCd6NXrCOJ5HhWDzjQjJMozLC8YiPG6fZRbeT4ToGNdXYhJWiyLiFeYtVzSMj1fD9Ir/EakbLtey4Lq2A53RzdHThSQpCwPA4BgIA="); var_Appearance->Add(2,_bstr_t("gBFLBCJwBAEHhEJAADhABcMIQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYE") + "DGHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NrXHZ9YwTOC5IDke67cr2J53XZAd4QTb2Cz7QC8" + "QAvDA7awafM1MSuHIcOw/AqTYDkTq4XjODYhTDEc4zPLcFx/I6haBoWCSLi+T5VVrRMo1TKtRxnNaubZqO5aRrGe5NW6EXThSQpCr+f4BgIA="); var_Appearance->Add(3,_bstr_t("gBFLBCJwBAEHhEJAADhABcMIQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYE") + "DGHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NwXFaNZznBK7LpvK5HNrie55XxfV6YBa8B4JPaE" + "ZLwLB7dwaf6IQLiWLYHiAAYZRKTcxlDI8AwvFaaZjnWA5ZaOMZBU7RNRyHR9IyTDaWaTqeqbHIuJ4FUzaNY2fZrOz2F6FAA6cKSFIWFYVAMBA"); var_Appearance->Add(4,_bstr_t("gBFLBCJwBAEHhEJAADhABb8IQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYE") + "DGHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NwXFaNZznBK7LpvK5HNrie55XxfV6YBa8B4JPaE" + "ZLwLB7dwaf6IQLiWLYHiAAYBIbJI5yeb5Hx3HqfZjbeSxVoML43SzHcByGRcTwzC6pYjrGoZJpWZ4ZQrbNR3DZ8VzzNTrQxIUhYVhUAkB"); var_Appearance->PutRenderType(-16777216); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,164); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutNonworkingDaysColor(RGB(240,240,240)); var_Chart->PutNonworkingDaysPattern(EXG2ANTTLib::exPatternBDiagonal); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->GetItem("Task"); var_Bar->PutHeight(17); var_Bar->PutColor(RGB(255,255,255)); var_Bar->PutPattern(EXG2ANTTLib::exPatternSolid); var_Bar->PutDef(EXG2ANTTLib::exBarFrameColor,long(1)); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Task"),"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"",vtMissing); long h = var_Items->AddItem("Task+Rhombus(red)"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(100%-11,50%-6,11,11),back=0x10000FF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,",,5"); h = var_Items->AddItem("Rhombus(red)+Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(0,50%-6,11,11),back=0x10000FF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,"-5"); h = var_Items->AddItem("Task(yellow)+Rhombus(blue)"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(100%-11,50%-6,11,11),back=0x1FF0000]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,",,5"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(65535)); h = var_Items->AddItem("Rhombus(blue)+Task(yellow)"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(0,50%-6,11,11),back=0x1FF0000]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,"-5"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(65535)); h = var_Items->AddItem("TriangleUp(white)+Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(0,50%-6,11,11),back=0x2FFFFFF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,"-5"); h = var_Items->AddItem("TriangleUp(blue)+Task(magenta)+TriangleDown(red)"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(0,50%-6,11,11),back=0x02FF0000],none[(100%-11,50%-6,11,11),back=0x030000FF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,"-5,0,5,0"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(16744703)); h = var_Items->AddItem("Rhombus+Task+TriangleDown"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(0,50%-6,11,11),back=0x01FF0000],none[(100%-11,50%-6,11,11),back=0x030000FF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,"-5, 0,5,0"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(16744448)); h = var_Items->AddItem("Rhombus+Task+TriangleDown"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(50%-6,0,11,11),back=0x01FF0000],none[(50%-6,100%-11,11,11),back=0x010000FF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,"0,-5,0,5"); h = var_Items->AddItem("Task+Star"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,9,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(100%-11,0,11,11),back=0x4FFFFFF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,long(5)); h = var_Items->AddItem("Star+Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,8,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(0,100%-11,11,11),back=0x04FFFFFF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,long(5)); h = var_Items->AddItem("Task+Star"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,7,0,00,00).operator DATE(),"",vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExt,"none[(100%-11,0,11,11),back=0x4FFFFFF]"); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarBackgroundExtInflate,"0,-6,14"); spG2antt1->EndUpdate(); |
1732 |
I am using the ItemBar(exBarFrameColor) to display an additional EBN on the current bar. The problem is that I still need a black frame around the bar. How can I achieve that
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAADhABXMIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EQLhGBRQCULQxDCBMIjLJoWhsASVRhnCBBR") + "hwAI7ShPUBgXBNCQzICTJJkSJZBiECIJFAaJhnIapZDKGKQWCjAgiNpqGQ2QiKFC2HAcEAxCxGJBoKKZGq2bpJQLbdxUXRVZzpNi7Louay5CrOCZvXxaeAXDa+Az5ODD" + "MRwLBcKhzCKDYzfdrZFaWFT3Qi8aCvG6sbw/HZ0OrEEIwCEBA"); var_Appearance->Add(2,"CP:1 0 0 5 0"); var_Appearance->Add(3,_bstr_t("gBFLBCJwBAEHhEJAADhABUEIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLIxhEYobgmGIaRiBMIxAKIZhzEgYRoiAYhXDiHwxARHUgRfIEOwHDiBZomWKZE") + "iaKIqRrLMryFLMZx3CqcAApGaqHiOCYlSbTcoyfJYZBzD6mKJpWipWheW48U7PVRDJSkNysASZIyrGKqJouX4WR7BcZgNR4YBgEoWRouSBLWrgNIVR6/eBABZFPzbNK3" + "ZzdOIIJgEgIA="); var_Appearance->PutRenderType(-16777216); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,164); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->GetBars()->GetItem("Task")->PutColor(0x3ff0000); var_Chart->GetBars()->Copy(L"Task",L"NewTask")->PutHeight(15); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(h,"NewTask",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,12,0,00,00).operator DATE(),"new",vtMissing); h = var_Items->AddItem("Task+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554432)); var_Items->AddBar(h,"NewTask",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,12,0,00,00).operator DATE(),"new",vtMissing); var_Items->PutItemBar(h,"new",EXG2ANTTLib::exBarFrameColor,long(33554432)); h = var_Items->AddItem("Task/Color+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554687)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(65280)); var_Items->AddBar(h,"NewTask",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,12,0,00,00).operator DATE(),"new",vtMissing); var_Items->PutItemBar(h,"new",EXG2ANTTLib::exBarFrameColor,long(33554687)); var_Items->PutItemBar(h,"new",EXG2ANTTLib::exBarColor,long(65280)); h = var_Items->AddItem("Task/Color+Rhombus/Color"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33619712)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(16711935)); var_Items->AddBar(h,"NewTask",COleDateTime(2001,1,8,0,00,00).operator DATE(),COleDateTime(2001,1,12,0,00,00).operator DATE(),"new",vtMissing); var_Items->PutItemBar(h,"new",EXG2ANTTLib::exBarFrameColor,long(33619712)); var_Items->PutItemBar(h,"new",EXG2ANTTLib::exBarColor,long(16711935)); spG2antt1->EndUpdate(); |
1731 |
I am using EBN objects to show my bars, but when apply a color to the EBN looks darker. Is it possible to get the same color brightness
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAADhABWkIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EZBGABYJDUMAlCyNQBQSKIYxnAgYY4ACZ5I") + "jqAwLQjQEYzZI0SxJCqQZBBCCSQKkYx0HScRijDILBQwIQmaqjEZoJCiQZfQLCAYRMhkQx9DKTLRtKhYDqubpHUZbdwWRaVYTlM6RLbhGy7YqefJtXLfN4WZgWCz9QLD" + "I4wS78JruaqOW5hVz4BasfTrOzLcTzG4HLhCCYBgI"); var_Appearance->Add(2,"CP:1 -6 0 0 0"); var_Appearance->PutRenderType(-16777216); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,164); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem("Task+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554432)); h = var_Items->AddItem("Task/Color+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554687)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(65280)); h = var_Items->AddItem("Task/Color+Rhombus/Color"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33619712)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(16711935)); spG2antt1->EndUpdate(); |
1730 |
The ItemBar(exBarColor) changes the color for margins, and there is no exBarStartColor/exBarEndColor. However in my case I would then like do dynamically change the bar color to a different color without changing the start shape color
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAADhABWkIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EZBGABYJDUMAlCyNQBQSKIYxnAgYY4ACZ5I") + "jqAwLQjQEYzZI0SxJCqQZBBCCSQKkYx0HScRijDILBQwIQmaqjEZoJCiQZfQLCAYRMhkQx9DKTLRtKhYDqubpHUZbdwWRaVYTlM6RLbhGy7YqefJtXLfN4WZgWCz9QLD" + "I4wS78JruaqOW5hVz4BasfTrOzLcTzG4HLhCCYBgI"); var_Appearance->Add(2,"CP:1 -6 0 0 0"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,164); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem("Task+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554432)); h = var_Items->AddItem("Task/Color+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554432)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(65280)); h = var_Items->AddItem("Task/Color+Rhombus/Color"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33619712)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(16711935)); spG2antt1->EndUpdate(); |
1729 |
The ItemBar(exBarColor) changes the color for margins, and there is no exBarStartColor/exBarEndColor. However in my case I would then like do dynamically change the bar color to a different color without changing the end shape color
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IAppearancePtr var_Appearance = spG2antt1->GetVisualAppearance(); var_Appearance->Add(1,_bstr_t("gBFLBCJwBAEHhEJAADhABXMIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EQLhGBRQCULQxDCBMIjLJoWhsASVRhnCBBR") + "hwAI7ShPUBgXBNCQzICTJJkSJZBiECIJFAaJhnIapZDKGKQWCjAgiNpqGQ2QiKFC2HAcEAxCxGJBoKKZGq2bpJQLbdxUXRVZzpNi7Louay5CrOCZvXxaeAXDa+Az5ODD" + "MRwLBcKhzCKDYzfdrZFaWFT3Qi8aCvG6sbw/HZ0OrEEIwCEBA"); var_Appearance->Add(2,"CP:1 0 0 6 0"); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,164); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); spG2antt1->GetColumns()->Add(L"Column"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Task"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); h = var_Items->AddItem("Task+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554432)); h = var_Items->AddItem("Task/Color+Rhombus"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33554432)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(65280)); h = var_Items->AddItem("Task/Color+Rhombus/Color"); var_Items->AddBar(h,"Task",COleDateTime(2001,1,2,0,00,00).operator DATE(),COleDateTime(2001,1,6,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarFrameColor,long(33619712)); var_Items->PutItemBar(h,"",EXG2ANTTLib::exBarColor,long(16711935)); spG2antt1->EndUpdate(); |
1728 |
Is it possible to resize a column with the mouse without changing the width of the next column
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column 1")))->PutWidth(256); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Column 2")))->PutWidth(512); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->EndUpdate(); |
1727 |
How can I align captions of items with checkbox, with items with no checkbox
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutCellImages(var_Items->AddItem(long(0)),long(0),"1"); var_Items->PutCellHasCheckBox(var_Items->AddItem(long(1)),long(0),VARIANT_TRUE); var_Items->PutCellImages(var_Items->AddItem(long(2)),long(0),"1"); spG2antt1->EndUpdate(); |
1726 |
How can I show each group header ( not-subroup ), with a different background color, while alternate background colors for inside items
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,312); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column->PutFormatColumn(L"(0:= (1 rpos '')) right ( ( 1:= ( =:0 rfind `.` ) ) != -1 ? =:1 : len(=:0))"); var_Column->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column1->PutFormatColumn(L"(1 rpos '') contains '.'"); var_Column1->PutVisible(VARIANT_FALSE); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 2) != 0",vtMissing)->PutBackColor(RGB(240,240,240)); spG2antt1->GetConditionalFormats()->Add(L"%C14 = 0",vtMissing)->PutBackColor(RGB(190,190,190)); spG2antt1->EndUpdate(); |
1725 |
What is the difference between %0 and %C0, when using in expressions ( format, conditional format, computed fields, and so on )
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); spG2antt1->PutHeaderAppearance(EXG2ANTTLib::Etched); spG2antt1->PutHeaderHeight(24); spG2antt1->PutScrollBySingleLine(VARIANT_TRUE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exRowLines); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Value")))->PutDef(EXG2ANTTLib::exCellValueFormat,long(1)); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"FormatColumn = `%0` ~ CellValue"))); var_Column->PutFormatColumn(L"%0"); var_Column->PutDef(EXG2ANTTLib::exCellSingleLine,VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"FormatColumn = `%C0`~ CellCaption"))); var_Column1->PutFormatColumn(L"%C0"); var_Column1->PutDef(EXG2ANTTLib::exCellSingleLine,VARIANT_FALSE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(double(1.1234)); var_Items->PutCellValueFormat(var_Items->AddItem("<sha ;;0>This <fgcolor=FF0000>is a <s><b>HTM</fgcolor>L</b> text</s>."),long(0),EXG2ANTTLib::exHTML); EXG2ANTTLib::IEditorPtr var_Editor = var_Items->GetCellEditor(var_Items->AddItem(long(3)),vtMissing); var_Editor->PutEditType(EXG2ANTTLib::CheckListType); var_Editor->AddItem(1,L"Border",vtMissing); var_Editor->AddItem(2,L"Thick",vtMissing); var_Editor->AddItem(4,L"Shadow",vtMissing); var_Items->PutFormatCell(var_Items->AddItem(long(10000)),long(0),L"`<b>` + currency(value)"); spG2antt1->EndUpdate(); |
1724 |
How can I alternate colors for each group header ( not-subroup ), with a different background color, while items of the same group showing with a different color
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,312); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column->PutFormatColumn(L"(0:= (1 rpos '')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))"); var_Column->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column1->PutFormatColumn(L"(1 rpos '') contains '.'"); var_Column1->PutVisible(VARIANT_FALSE); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 2) != 0",vtMissing)->PutBackColor(RGB(240,240,240)); spG2antt1->GetConditionalFormats()->Add(L"%C14 = 0",vtMissing)->PutBackColor(RGB(190,190,190)); spG2antt1->EndUpdate(); |
1723 |
How can I highlight each group header, with a different background color (method 2)
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutItemBackColor(Item,RGB(190,190,190)); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,312); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); |
1722 |
How can I highlight each group header ( not-subroup ), with a different background color (method 1)
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,312); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column->PutFormatColumn(L"(0:= (1 rpos '')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))"); var_Column->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column1->PutFormatColumn(L"(1 rpos '') contains '.'"); var_Column1->PutVisible(VARIANT_FALSE); spG2antt1->GetConditionalFormats()->Add(L"%C14 = 0",vtMissing)->PutBackColor(RGB(190,190,190)); spG2antt1->EndUpdate(); |
1721 |
The BackColorAlternate displays each second row with a different background color. Is it possible to apply a different background color, for each sub-tree, ConditionalFormats, Add
// LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } // Sort event - Fired when the control sorts a column. void OnSortG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutLinesAtRoot(EXG2ANTTLib::exLinesAtRoot); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"P1"))); var_Column->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column->PutPartialCheck(VARIANT_TRUE); spG2antt1->GetChart()->PutPaneWidth(VARIANT_TRUE,0); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"P2"))); var_Column1->PutDef(EXG2ANTTLib::exCellHasCheckBox,VARIANT_TRUE); var_Column1->PutPartialCheck(VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Root 1"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); h = var_Items->AddItem("Root 2"); var_Items->InsertItem(h,vtMissing,"Child 1"); var_Items->InsertItem(h,vtMissing,"Child 2"); var_Items->PutExpandItem(h,VARIANT_TRUE); EXG2ANTTLib::IColumnPtr var_Column2 = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column2->PutFormatColumn(L"(0:= (1 rpos '')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))"); var_Column2->PutVisible(VARIANT_FALSE); spG2antt1->GetConditionalFormats()->Add(L"(%C2 mod 2) != 0",vtMissing)->PutBackColor(RGB(240,240,240)); spG2antt1->EndUpdate(); |
1720 |
The BackColorAlternate displays each second row with a different background color. Is it possible to apply a different background color, for 2nd, 3rd, 4th, row, and so on
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,312); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column->PutFormatColumn(L"1 apos ''"); var_Column->PutVisible(VARIANT_FALSE); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 5) = 1",vtMissing)->PutBackColor(RGB(128,128,128)); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 5) = 2",vtMissing)->PutBackColor(RGB(164,164,164)); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 5) = 3",vtMissing)->PutBackColor(RGB(190,190,190)); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 5) = 4",vtMissing)->PutBackColor(RGB(240,240,240)); spG2antt1->EndUpdate(); |
1719 |
The BackColorAlternate displays each second row with a different background color. The question I have it is possible to apply a different background color for 3rd, 4th, row, and so on
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,312); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column->PutFormatColumn(L"1 apos ''"); var_Column->PutVisible(VARIANT_FALSE); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 4) = 0",vtMissing)->PutBackColor(RGB(240,240,240)); spG2antt1->EndUpdate(); |
1718 |
The BackColorAlternate looks fine for flat tables, but how about using it when displaying a hierarchy/tree, like grouping rows. The sample alternate colors for each group found
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } // LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->Refresh(); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->GetChart()->PutPaneWidth(VARIANT_FALSE,312); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->GetItems()->PutAllowCellValueToItemBar(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(2))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); spG2antt1->GetColumns()->GetItem(long(4))->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Position"))); var_Column->PutFormatColumn(L"(0:= (1 rpos '')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))"); var_Column->PutVisible(VARIANT_FALSE); spG2antt1->GetConditionalFormats()->Add(L"(%C13 mod 2) != 0",vtMissing)->PutBackColor(RGB(240,240,240)); spG2antt1->EndUpdate(); |
1717 |
How do I show the chart's labels in 24-hour clock format
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(3); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutLabel("<%mmm%> <%d%>, <%yyyy%>"); var_Level->PutAlignment(EXG2ANTTLib::AlignmentEnum(EXG2ANTTLib::exHOutside | EXG2ANTTLib::CenterAlignment)); var_Level->PutUnit(EXG2ANTTLib::exDay); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutLabel("<b><%h%>:00</b>"); var_Level1->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Level1->PutUnit(EXG2ANTTLib::exHour); var_Level1->PutDrawTickLines(EXG2ANTTLib::exLevelDefaultLine); var_Level1->PutDrawGridLines(VARIANT_TRUE); EXG2ANTTLib::ILevelPtr var_Level2 = var_Chart->GetLevel(2); var_Level2->PutLabel("<%nn%>"); var_Level2->PutUnit(EXG2ANTTLib::exMinute); var_Level2->PutCount(15); var_Chart->ScrollTo(COleDateTime(2001,1,1,8,30,00).operator DATE(),long(0)); |
1716 |
How do I show the chart's labels in 12-hour clock format
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutFirstVisibleDate(COleDateTime(2001,1,1,0,00,00).operator DATE()); var_Chart->PutLevelCount(3); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutLabel("<%mmm%> <%d%>, <%yyyy%>"); var_Level->PutAlignment(EXG2ANTTLib::AlignmentEnum(EXG2ANTTLib::exHOutside | EXG2ANTTLib::CenterAlignment)); var_Level->PutUnit(EXG2ANTTLib::exDay); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutLabel("<b><%h%>:00</b> <%AM/PM%>"); var_Level1->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Level1->PutUnit(EXG2ANTTLib::exHour); var_Level1->PutDrawTickLines(EXG2ANTTLib::exLevelDefaultLine); var_Level1->PutDrawGridLines(VARIANT_TRUE); EXG2ANTTLib::ILevelPtr var_Level2 = var_Chart->GetLevel(2); var_Level2->PutLabel("<%nn%>"); var_Level2->PutUnit(EXG2ANTTLib::exMinute); var_Level2->PutCount(15); var_Chart->ScrollTo(COleDateTime(2001,1,1,8,30,00).operator DATE(),long(0)); |
1715 |
I would like to avoid manual typing in the date-cell because user often type wrong things (no decimal points and so on) and so the todays-date is generated for the cell. What can be done
// KeyPress event - Occurs when the user presses and releases an ANSI key. void OnKeyPressG2antt1(short FAR* KeyAscii) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"if .Editying != 0 then" ); OutputDebugStringW( _bstr_t(spG2antt1->GetEditing()) ); KeyAscii = 0; } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); var_Columns->Add(L"Tasks"); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"Start"))); var_Column->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(1)); var_Column->GetEditor()->PutEditType(EXG2ANTTLib::DateType); EXG2ANTTLib::IColumnPtr var_Column1 = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"End"))); var_Column1->PutDef(EXG2ANTTLib::exCellValueToItemBarProperty,long(2)); var_Column1->GetEditor()->PutEditType(EXG2ANTTLib::DateType); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutAllowLinkBars(VARIANT_TRUE); var_Chart->PutAllowCreateBar(EXG2ANTTLib::exNoCreateBar); var_Chart->PutLevelCount(2); var_Chart->PutPaneWidth(VARIANT_FALSE,196); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutAllowCellValueToItemBar(VARIANT_TRUE); var_Items->AddBar(var_Items->AddItem("Task 1"),"Task",COleDateTime(2006,9,21,0,00,00).operator DATE(),COleDateTime(2006,9,24,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 2"),"Task",COleDateTime(2006,9,22,0,00,00).operator DATE(),COleDateTime(2006,9,25,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Task 3"),"Task",COleDateTime(2006,9,23,0,00,00).operator DATE(),COleDateTime(2006,9,26,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1714 |
When a Day, Week etc is clicked how can we make it centre/zoom the chart to cover all the bars
// OverviewZoom event - Occurs once the user selects a new time scale unit in the overview zoom area. void OnOverviewZoomG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->ScrollTo(COleDateTime(2001,1,1,0,00,00).operator DATE(),long(1)); OutputDebugStringW( L"Start" ); OutputDebugStringW( _bstr_t(var_Chart->GetStartPrintDate()) ); OutputDebugStringW( L"End" ); OutputDebugStringW( _bstr_t(var_Chart->GetEndPrintDate()) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); var_Chart->PutAllowOverviewZoom(EXG2ANTTLib::exAlwaysZoom); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); var_Chart->PutLabel(EXG2ANTTLib::exMinute,L""); var_Chart->PutLabel(EXG2ANTTLib::exHour,L""); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->ScrollTo(COleDateTime(2001,1,1,0,00,00).operator DATE(),long(1)); var_Chart->MarkTimeZone("zone",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,2,0,00,00).operator DATE(),long(10516548),vtMissing); spG2antt1->GetColumns()->Add(L"Default"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(var_Items->AddItem("Item 1"),"Task",COleDateTime(2000,12,15,0,00,00).operator DATE(),COleDateTime(2001,1,10,0,00,00).operator DATE(),vtMissing,vtMissing); var_Items->AddBar(var_Items->AddItem("Item 2"),"Task",COleDateTime(2001,1,1,0,00,00).operator DATE(),COleDateTime(2001,1,5,0,00,00).operator DATE(),vtMissing,vtMissing); spG2antt1->EndUpdate(); |
1713 |
The first time we run the application, the day label headers looks different then pressing Week and then Day again on the control's overview part. How do we make to show the header in the same format
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutPaneWidth(VARIANT_FALSE,128); var_Chart->PutLevelCount(2); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); var_Chart->PutAllowOverviewZoom(EXG2ANTTLib::exAlwaysZoom); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); var_Chart->PutLabel(EXG2ANTTLib::exMinute,L""); var_Chart->PutLabel(EXG2ANTTLib::exHour,L""); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); |
1712 |
How to sort numerically by columns
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Numeric")))->PutSortType(EXG2ANTTLib::SortNumeric); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem(long(1)); var_Items->AddItem(long(2)); var_Items->AddItem(long(12)); var_Items->AddItem(long(22)); spG2antt1->GetColumns()->GetItem(long(0))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); |
1711 |
The control does not ensure the item to fit the control's client area once the user clicks the cell's button or check box. What can be done
// MouseDown event - Occurs when the user presses a mouse button. void OnMouseDownG2antt1(short Button,short Shift,long X,long Y) { // Items.EnsureVisibleItem(ItemFromPoint(-1,-1,c,hit)) } /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutTreeColumnIndex(-1); spG2antt1->PutSelForeColor(spG2antt1->GetForeColor()); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Buttons"))); var_Column->PutAlignment(EXG2ANTTLib::CenterAlignment); var_Column->PutDef(EXG2ANTTLib::exCellHasButton,VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddItem("Button A"); var_Items->AddItem("Button B"); var_Items->AddItem("Button C"); spG2antt1->EndUpdate(); |
1710 |
How do I arrange the levels when the user changes the scale using the control's overview part
// OverviewZoom event - Occurs once the user selects a new time scale unit in the overview zoom area. void OnOverviewZoomG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( _bstr_t(spG2antt1->GetChart()->GetUnitScale()) ); spG2antt1->EnsureVisibleColumn(long(0)); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->GetLevel(0)->PutDrawTickLines(EXG2ANTTLib::exLevelNoLine); var_Chart->ScrollTo(COleDateTime(2015,11,18,0,00,00).operator DATE(),long(1)); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2015,11,18,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,0); var_Chart->PutLevelCount(2); var_Chart->PutDrawLevelSeparator(EXG2ANTTLib::exLevelSolidLine); EXG2ANTTLib::ILevelPtr var_Level = var_Chart->GetLevel(0); var_Level->PutAlignment(EXG2ANTTLib::AlignmentEnum(EXG2ANTTLib::exHOutside | EXG2ANTTLib::CenterAlignment)); var_Level->PutDrawTickLines(EXG2ANTTLib::exLevelSolidLine); var_Level->PutBackColor(spG2antt1->GetBackColor()); EXG2ANTTLib::ILevelPtr var_Level1 = var_Chart->GetLevel(1); var_Level1->PutDrawTickLines(EXG2ANTTLib::LevelLineEnum(EXG2ANTTLib::exLevelMiddleLine | EXG2ANTTLib::exLevelDotLine)); var_Level1->DrawTickLinesFrom(0,EXG2ANTTLib::exLevelSolidLine); var_Chart->PutOverviewVisible(EXG2ANTTLib::exOverviewShowAllVisible); var_Chart->PutAllowOverviewZoom(EXG2ANTTLib::exAlwaysZoom); var_Chart->PutUnitWidth(24); var_Chart->PutLabel(EXG2ANTTLib::exSecond,L""); var_Chart->PutLabel(EXG2ANTTLib::exMinute,L""); var_Chart->PutLabel(EXG2ANTTLib::exHour,L""); var_Chart->PutLabel(EXG2ANTTLib::exWeek,L""); var_Chart->PutLabel(EXG2ANTTLib::exDay,L"<|><%d%><|><%d3%>, <%m3%> <%d%>, '<%yy%><|><%dddd%>, <%mmmm%> <%d%>, <%yyyy%><||><||>4096"); var_Chart->PutUnitScale(EXG2ANTTLib::exDay); var_Chart->ScrollTo(var_Chart->GetFirstVisibleDate(),long(1)); spG2antt1->GetColumns()->Add(L"Default"); spG2antt1->EndUpdate(); |
1709 |
I am using AllowGroupBy, the question is it is possible to add summary bars for child item, when user do grouping
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Summary",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); var_Items->DefineSummaryBars(Item,"",-3,""); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); |
1708 |
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 3)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetChart()->PutShowCollapsedBars(VARIANT_TRUE); spG2antt1->EndUpdate(); spG2antt1->PutLayout(L"multiplesort=\"C1:1\";collapse=\"0-9999\""); |
1707 |
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 2)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); spG2antt1->BeginUpdate(); spG2antt1->EnsureVisibleColumn(long(0)); spG2antt1->GetItems()->PutExpandItem(0,VARIANT_FALSE); spG2antt1->EndUpdate(); |
1706 |
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 1)
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void OnAddGroupItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->GetItems()->PutExpandItem(Item,VARIANT_FALSE); } // AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); |
1705 |
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); spG2antt1->EnsureVisibleColumn(long(0)); spG2antt1->BeginUpdate(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutExpandItem(var_Items->GetRootItem(0),VARIANT_FALSE); var_Items->PutExpandItem(var_Items->GetRootItem(1),VARIANT_FALSE); var_Items->PutExpandItem(var_Items->GetRootItem(2),VARIANT_FALSE); spG2antt1->EndUpdate(); |
1704 |
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)
// AddItem event - Occurs after a new Item has been inserted to Items collection. void OnAddItemG2antt1(long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->AddBar(Item,"Task",var_Items->GetCellValue(Item,long(2)),var_Items->GetCellValue(Item,long(4)),vtMissing,vtMissing); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->GetChart()->PutFirstVisibleDate(COleDateTime(1994,9,1,0,00,00).operator DATE()); spG2antt1->PutBackColorSortBar(spG2antt1->GetBackColor()); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); /* Includes the definition for CreateObject function like follows: #include <comdef.h> IUnknownPtr CreateObject( BSTR Object ) { IUnknownPtr spResult; spResult.CreateInstance( Object ); return spResult; }; */ /* Copy and paste the following directives to your header file as it defines the namespace 'ADODB' for the library: 'Microsoft ActiveX Data Objects 6.1 Library' #import <msado15.dll> rename("EOF","REOF") */ ADODB::_RecordsetPtr rs = ::CreateObject(L"ADOR.Recordset"); rs->Open("Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2antt\\Sample\\Access\\misc.accdb",ADODB::adOpenStatic,ADODB::adLockOptimistic,0); spG2antt1->PutDataSource(((ADODB::_RecordsetPtr)(rs))); spG2antt1->PutSortBarVisible(VARIANT_TRUE); spG2antt1->PutSortBarCaption(L"Drag a <b>column</b> header here to group by that column."); spG2antt1->PutAllowGroupBy(VARIANT_TRUE); spG2antt1->GetColumns()->GetItem(long(1))->PutSortOrder(EXG2ANTTLib::SortAscending); spG2antt1->EndUpdate(); spG2antt1->BeginUpdate(); spG2antt1->EnsureVisibleColumn(long(0)); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); var_Items->PutExpandItem(var_Items->GetFirstVisibleItem(),VARIANT_FALSE); spG2antt1->EndUpdate(); |
1703 |
How can I move automatically a bar once another is moved ( non-working bars )
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutMarkSearchColumn(VARIANT_FALSE); spG2antt1->PutOnResizeControl(EXG2ANTTLib::exResizeChart); spG2antt1->GetColumns()->Add(L"Tasks"); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"Start")))->PutVisible(VARIANT_FALSE); ((EXG2ANTTLib::IColumnPtr)(spG2antt1->GetColumns()->Add(L"End")))->PutVisible(VARIANT_FALSE); EXG2ANTTLib::IChartPtr var_Chart = spG2antt1->GetChart(); var_Chart->PutFirstVisibleDate(COleDateTime(2006,9,20,0,00,00).operator DATE()); var_Chart->PutPaneWidth(VARIANT_FALSE,64); EXG2ANTTLib::IBarPtr var_Bar = var_Chart->GetBars()->Add(L"Task:Split"); var_Bar->PutShortcut(L"TSplit"); var_Bar->PutDef(EXG2ANTTLib::exBarKeepWorkingCount,VARIANT_TRUE); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Project"); var_Items->PutCellValue(h,long(1),COleDateTime(2006,9,22,0,00,00).operator DATE()); var_Items->PutCellValue(h,long(2),COleDateTime(2006,10,3,0,00,00).operator DATE()); var_Items->AddBar(h,"Summary",var_Items->GetCellValue(h,long(1)),var_Items->GetCellValue(h,long(2)),vtMissing,vtMissing); long h1 = var_Items->InsertItem(h,vtMissing,"Task 1"); var_Items->PutCellValue(h1,long(1),var_Items->GetCellValue(h,long(1))); var_Items->PutCellValue(h1,long(2),COleDateTime(2006,9,26,0,00,00).operator DATE()); var_Items->AddBar(h1,"TSplit",var_Items->GetCellValue(h1,long(1)),var_Items->GetCellValue(h1,long(2)),vtMissing,vtMissing); long h2 = var_Items->InsertItem(h,vtMissing,"Task 2"); var_Items->PutCellValue(h2,long(1),var_Items->GetCellValue(h1,long(2))); var_Items->PutCellValue(h2,long(2),COleDateTime(2006,9,28,0,00,00).operator DATE()); var_Items->AddBar(h2,"TSplit",var_Items->GetCellValue(h2,long(1)),var_Items->GetCellValue(h2,long(2)),vtMissing,vtMissing); var_Items->AddLink("L1",h1,"",h2,""); long h3 = var_Items->InsertItem(h,vtMissing,"Task 3"); var_Items->PutCellValue(h3,long(1),var_Items->GetCellValue(h2,long(2))); var_Items->PutCellValue(h3,long(2),var_Items->GetCellValue(h,long(2))); var_Items->AddBar(h3,"TSplit",var_Items->GetCellValue(h3,long(1)),var_Items->GetCellValue(h3,long(2)),vtMissing,vtMissing); var_Items->AddLink("L2",h2,"",h3,""); var_Items->GroupBars(h1,"",VARIANT_FALSE,h2,"",VARIANT_TRUE,long(7),vtMissing); var_Items->GroupBars(h2,"",VARIANT_FALSE,h3,"",VARIANT_TRUE,long(7),vtMissing); var_Items->DefineSummaryBars(h,"",h1,""); var_Items->DefineSummaryBars(h,"",h2,""); var_Items->DefineSummaryBars(h,"",h3,""); var_Items->PutExpandItem(h,VARIANT_TRUE); var_Items->PutItemBold(h,VARIANT_TRUE); spG2antt1->EndUpdate(); |
1702 |
How can I get notified once the user expands a column
// LayoutChanged event - Occurs when column's position or column's size is changed. void OnLayoutChangedG2antt1() { /* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); OutputDebugStringW( L"Column-Expanded" ); OutputDebugStringW( _bstr_t(spG2antt1->GetColumns()->GetItem("C0")->GetExpanded()) ); } EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutShowFocusRect(VARIANT_FALSE); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C0"))); var_Column->PutExpandColumns(L"0,1,2"); var_Column->PutDisplayExpandButton(VARIANT_TRUE); var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Cell 0.0"); var_Items->PutCellValue(h,long(1),"Cell 0.1"); var_Items->PutCellValue(h,long(2),"Cell 0.2"); h = var_Items->AddItem("Cell 1.0"); var_Items->PutCellValue(h,long(1),"Cell 1.1"); var_Items->PutCellValue(h,long(2),"Cell 1.2"); spG2antt1->EndUpdate(); |
1701 |
I am using expandable headers, the question is how I can display the column itself, not just the child columns
/* Copy and paste the following directives to your header file as it defines the namespace 'EXG2ANTTLib' for the library: 'ExG2antt 1.0 Control Library' #import <ExG2antt.dll> using namespace EXG2ANTTLib; */ EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown(); spG2antt1->BeginUpdate(); spG2antt1->PutColumnAutoResize(VARIANT_FALSE); spG2antt1->PutDrawGridLines(EXG2ANTTLib::exAllLines); spG2antt1->PutBackColorLevelHeader(spG2antt1->GetBackColor()); EXG2ANTTLib::IColumnsPtr var_Columns = spG2antt1->GetColumns(); EXG2ANTTLib::IColumnPtr var_Column = ((EXG2ANTTLib::IColumnPtr)(var_Columns->Add(L"C0"))); var_Column->PutExpandColumns(L"0,1,2"); var_Column->PutDisplayExpandButton(VARIANT_TRUE); var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems(); long h = var_Items->AddItem("Cell 0.0"); var_Items->PutCellValue(h,long(1),"Cell 0.1"); var_Items->PutCellValue(h,long(2),"Cell 0.2"); h = var_Items->AddItem("Cell 1.0"); var_Items->PutCellValue(h,long(1),"Cell 1.1"); var_Items->PutCellValue(h,long(2),"Cell 1.2"); spG2antt1->EndUpdate(); |